import unittest
import jsonpath
import requests

from common import pubilc_api_info
from common.config_utils import config


class TestsDeleteUserTagApi(unittest.TestCase):
    def setUp(self) -> None:
        self.hosts = config.HOSTS
        self.session = requests.session()

    def tearDown(self) -> None:
        self.session.close()

    def test_tagid_0(self):
        self._testMethodName = 'VXC_YH_001'
        self._testMethodDoc = '验证不为0'
        token_id=pubilc_api_info.get_access_token(self.session)
        url_params = {
            "access_token": token_id
        }
        post_data = {"tag": {"id": 0}}
        response = pubilc_api_info.delete_user_tag_api(self.session, url_params, post_data)
        actual_result = jsonpath.jsonpath(response.json(), '$.errcode')[0]
        self.assertEqual(actual_result, 45058, '[VXC_YH_003]用例执行失败')


if __name__ == '__main__':
    unittest.main(verbosity=2)
